//
//  YXTaskListTableViewCell.m
//  MockProject
//
//  Created by FanYu on 22/8/2016.
//  Copyright © 2016 niuzhaowang. All rights reserved.
//

#import "YXTaskListTableViewCell.h"
#import "YXTaskModel.h"

@implementation YXTaskListTableViewCell

- (IBAction)actionButtonTapped:(UIButton *)sender {
    [self.delegate downloadButtonTapped:sender];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.titleLabel.textColor = [UIColor colorWithHexString:@"403e3d"];
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    
    self.timeLabel.textColor = [UIColor colorWithHexString:@"a3a1a0"];
    self.timeLabel.font = [UIFont systemFontOfSize:12];
    
    self.sizeLabel.textColor = [UIColor colorWithHexString:@"a3a1a0"];
    self.sizeLabel.font = [UIFont systemFontOfSize:12];
    
    [self.actionButton setImage:[UIImage imageNamed:@"下载按钮正常态"] forState:UIControlStateNormal];
    [self.actionButton setImage:[UIImage imageNamed:@"下载按钮点击态"] forState:UIControlStateHighlighted];
    
    self.timeImageView.image = [UIImage imageNamed:@"时间icon"];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

- (void)setTaskModel:(YXTaskModel *)taskModel {
    _taskModel = taskModel;
    
    self.titleLabel.text = taskModel.title;
    self.timeLabel.text = taskModel.time;
    self.sizeLabel.text = taskModel.size;
    self.status = taskModel.status;
    self.actionButton.tag = taskModel.uid.integerValue;
}

@end
